package cn.fiveinone;

/**
 * @Description
 * @auther Szper
 * @create 2019-10-24 15:59
 */
public class BaseContext extends BaseService {
    static <I extends BaseActive> void startService (String host, int port, String sn, I i) {
          try {
              putBean(host, false, port, sn, i);
          } catch (Exception e) {
              System.out.println("[BaseContext]" + "startService" );
          }
    }
    static <I extends BaseActive> void startService (String host, int port, String sn, I i, String cb, String pl) {
        try{
            putBean(host,false,port,sn,i,cb,pl,new SecurityManager());
            //pm.checkPermission(new ParkPermission("park","all"));
        }catch(Exception e){
            System.out.println("[ObjectService]" + "[startService]" + e);
        }
    }
    static <I extends BaseActive> I getService (Class<I> a, String host, int port, String sn) {
        I i = null;
        try {
            i = (I) getBean(host, port, sn);
        } catch (Exception e) {
            System.out.println("[BaseContext]" +  "[getService]" + e);
        }
        return i;
    }
}
